]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
St: don't attempt to give focus to non reactive actors
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 18 Jul 2012 10:19:55 +0000 (12:19 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 21 Jul 2012 13:40:28 +0000 (15:40 +0200)
Non reactive actors don't expect to be interacted with, and thus
should not get keyboard focus.

https://bugzilla.gnome.org/show_bug.cgi?id=619955

js/ui/networkAgent.js
js/ui/popupMenu.js
src/st/st-bin.c
src/st/st-entry.c
src/st/st-widget.c

index 1c29b98f353bf0ffeb167b4c0523bf6c22e1b393..0615a908bb867a3f62b58f8afb7e3e0dd6f261d4 100644 (file)
@@ -165,7 +165,6 @@ const NetworkSecretDialog = new Lang.Class({
         }
 
         this._okButton.button.reactive = valid;
-        this._okButton.button.can_focus = valid;
     },
 
     _onOk: function() {
index 54447caaaa3a21ae8e6aa61c50b570b9609cfbad..beb26cde438253ffa055c13cf6c7b5953e0cc216 100644 (file)
@@ -134,7 +134,6 @@ const PopupBaseMenuItem = new Lang.Class({
 
         this.sensitive = sensitive;
         this.actor.reactive = sensitive;
-        this.actor.can_focus = sensitive;
 
         if (sensitive)
             this.actor.remove_style_pseudo_class('insensitive');
@@ -773,12 +772,10 @@ const PopupSwitchMenuItem = new Lang.Class({
             this._statusLabel.text = text;
             this._statusBin.child = this._statusLabel;
             this.actor.reactive = false;
-            this.actor.can_focus = false;
             this.actor.accessible_role = Atk.Role.MENU_ITEM;
         } else {
             this._statusBin.child = this._switch.actor;
             this.actor.reactive = true;
-            this.actor.can_focus = true;
             this.actor.accessible_role = Atk.Role.CHECK_MENU_ITEM;
         }
         this.checkAccessibleState();
@@ -1891,7 +1888,7 @@ const RemoteMenu = new Lang.Class({
             }));
         }
 
-        item.actor.reactive = item.actor.can_focus = action.enabled;
+        item.actor.reactive = action.enabled;
         if (action.enabled)
             item.actor.remove_style_pseudo_class('insensitive');
         else
@@ -2027,7 +2024,7 @@ const RemoteMenu = new Lang.Class({
         if (action.items.length) {
             for (let i = 0; i < action.items.length; i++) {
                 let item = action.items[i];
-                item.actor.reactive = item.actor.can_focus = action.enabled;
+                item.actor.reactive = action.enabled;
 
                 if (action.enabled)
                     item.actor.remove_style_pseudo_class('insensitive');
index 71c7c3a5cf844eda127eac3979b200b3f05c3838..29cdccb2a92c44df9604860d9077f9e721c0c0ef 100644 (file)
@@ -195,7 +195,8 @@ st_bin_navigate_focus (StWidget         *widget,
   StBinPrivate *priv = ST_BIN (widget)->priv;
   ClutterActor *bin_actor = CLUTTER_ACTOR (widget);
 
-  if (st_widget_get_can_focus (widget))
+  if (clutter_actor_get_reactive (bin_actor) &&
+      st_widget_get_can_focus (widget))
     {
       if (from && clutter_actor_contains (bin_actor, from))
         return FALSE;
index a035cd264da5f3a08423f58a7ab80c343de8e4f9..32a1becb3950c448b5a899218614e1a70ee5c356 100644 (file)
@@ -285,7 +285,8 @@ st_entry_navigate_focus (StWidget         *widget,
 
   if (from == priv->entry)
     return FALSE;
-  else if (st_widget_get_can_focus (widget))
+  else if (clutter_actor_get_reactive (CLUTTER_ACTOR (widget)) &&
+           st_widget_get_can_focus (widget))
     {
       clutter_actor_grab_key_focus (priv->entry);
       return TRUE;
index f1962886d1c515aa71078deb948c38079057c767..6d6539378a804ee26ebc374de03c09ad73a2b7d5 100644 (file)
@@ -1880,7 +1880,8 @@ st_widget_real_navigate_focus (StWidget         *widget,
   while (focus_child && clutter_actor_get_parent (focus_child) != widget_actor)
     focus_child = clutter_actor_get_parent (focus_child);
 
-  if (widget->priv->can_focus)
+  if (clutter_actor_get_reactive (widget_actor) &&
+      widget->priv->can_focus)
     {
       if (!focus_child)
         {